// router.js

import { createRouter, createWebHistory } from 'vue-router'

const routes: RouteRecordRaw[] = [
  {
    path: '/',
    name: 'Home',
    component: () => import('../views/Home.vue') // 主页/博客列表页面
  },
  {
    path: '/blog/:id',
    name: 'BlogDetail',
    component: () => import('../views/BlogDetail.vue') // 博客详情页
  },
  {
    path: '/register',
    name: 'Register',
    component: () => import('../views/Register.vue') // 用户注册页面
  },
  {
    path: '/login',
    name: 'Login',
    component: () => import('../views/Login.vue') // 用户登录页面
  },
  {
    path: '/account',
    name: 'Account',
    component: () => import('../views/Account.vue') // 个人账户/用户管理页面
  },
  {
    path: '/create-edit-blog',
    name: 'CreateEditBlog',
    component: () => import('../views/CreateEditBlog.vue') // 创建/编辑博客页面
  },
  {
    path: '/my-blogs',
    name: 'MyBlogs',
    component: () => import('../views/MyBlogs.vue') // 我的博客
  }
]

const router = createRouter({
  history: createWebHistory(),
  routes
})

export default router
